#! /bin/bash
list_dir="sources.list.d"
apt_route="/data/data/com.termux/files/usr/etc/apt/"
x11_repo_route="${apt_route}${list_dir}/"
route="/data/data/com.termux/files/usr/bin/"
function ls_install {
	if ! ls "$1" | grep -q "$2"; then
		pkg install $3 -y
	fi
}
function ls_install_1 {
	if ! ls "$apt_route" | grep -q "$list_dir" || ! ls "$x11_repo_route" | grep -q "x11.list"; then
		pkg install x11-repo
	fi
}
ls_install_1
ls_install "$route" "termux-x11" "termux-x11"
ls_install "$route" "xfce4" "xfce4 firefox xfce4-goodies"
ls_install "$route" "python" "python-tkinter"
echo -e "xfce桌面已启动！\n按Ctrl+C停止！"
termux-x11 :1 -xstartup "dbus-launch --exit-with-session xfce4-session" &>/dev/null
